package main

import (
	"awesome-devops/applications"
	"fmt"
	"gitee.com/jjawesomejj/awesome-util/echo"
	awesomehttp "gitee.com/jjawesomejj/awesomehttp/system"
	"strings"
)

func main() {
	commandParams := echo.GetCmdParams()
	startFunc := "start"
	if len(commandParams) > 1 {
		startFunc = commandParams[1]
	}
	starter := applications.Starter{}
	tool := awesomehttp.ReflectTool{}
	if startFunc[0:1] == "-" {
		startFunc = "start"
	}
	startFunc = strings.ToUpper(startFunc[:1]) + startFunc[1:]
	if tool.MethodExist(starter, startFunc) {
		fmt.Println("拉起服务")
		tool.CallFunByName(starter, startFunc)
	} else {
		panic("无效启动参数:" + startFunc)
	}

}
